import { useSelector, useDispatch } from "react-redux";
import { selectUserInfo, selectUserMenus, logout } from "@/store/reducer/userSlice";

export const useInfo = () => {
  const dispatch = useDispatch();
  return {
    userInfo: useSelector(selectUserInfo),
    userMenus: useSelector(selectUserMenus),
    logout: () => dispatch(logout())
  };
};

export default useInfo;
